<!--conf
<sample in_favorites="true">
              <product version="1.4" edition="pro"/>
                     <modifications>
                            <modified date="070101"/>
                     </modifications>
               </sample>
 --> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
	<title>Tree related API </title>	
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/>
	<script src="../../../codebase/dhtmlx.js"></script>
</head>

<body>
	
	<h1>Tree related API </h1>
	<p>
            Use script methods to manipulate TreeGrid
	</p>


	<table width="575">
		<tr>
			<td>
				<div id="gridbox" width="100%" height="150px" style="background-color:white;"></div>
			</td>
		</tr>
		<tr>
			<td>
    <table>
        <tr>
        <td width="50%">
            	<a href="javascript:mygrid.setItemText(mygrid.getSelectedId(),'new text')">setItemText</a><br>
				<a href="javascript:alert(mygrid.getItemText(mygrid.getSelectedId()))">getItemText</a><br><br>

				<a href="javascript:mygrid.setItemCloseable(mygrid.getSelectedId(),false)">set Item Non-Closeable</a><br>
				<a href="javascript:mygrid.setItemCloseable(mygrid.getSelectedId(),true)">set Item Closeable</a><br><br>

				<a href="javascript:mygrid.openItem(mygrid.getSelectedId())">openItem</a><br>
				<a href="javascript:mygrid.closeItem(mygrid.getSelectedId())">closeItem</a><br>
				<a href="javascript:alert(mygrid.getOpenState(mygrid.getSelectedId()))">getOpenState</a><br><br>

        </td>
        <td>
                <a href="javascript:alert(mygrid.getParentId(mygrid.getSelectedId()))">getParentId</a><br>
                <a href="javascript:alert(mygrid.getLevel(mygrid.getSelectedId()))">getLevel</a><br><br>


				<a href="javascript:alert(mygrid.hasChildren(mygrid.getSelectedId()))">hasChildren</a><br>
    			<a href="javascript:alert(mygrid.getSubItems(mygrid.getSelectedId()))">getSubItems</a><br>
                <a href="javascript:alert(mygrid.getAllSubItems(mygrid.getSelectedId()))">getAllSubItems</a><br><br>

				<a href="javascript:alert(mygrid.getChildItemIdByIndex(mygrid.getSelectedId(),0))">getChildItemIdByIndex (first child of selected item)</a><br>
				<a href="javascript:mygrid.deleteChildItems(mygrid.getSelectedId())">deleteChildItems</a><br><br>
        </td>
        </tr>
    </table>




            </td>
		</tr>
	</table>


<script>
		mygrid = new dhtmlXGridObject('gridbox');

		
		mygrid.setImagePath("../../../codebase/imgs/");
		mygrid.setHeader("Tree,Plain Text,Long Text,Color,Checkbox");
		mygrid.setInitWidths("150,100,100,100,100")
		mygrid.setColAlign("left,left,left,left,center")
		mygrid.setColTypes("tree,ed,txt,ch,ch");
		mygrid.setColSorting("str,str,str,na,str")

		mygrid.init();
		mygrid.setSkin("dhx_skyblue")
	   	mygrid.loadXML("../common/test_list_1.xml");
</script>

</body>
</html>

